﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using DomainDriver.DomainModeling.DataProviders;

namespace DomainDriver.DomainModeling.Queries
{
    public class LinqQuery<T> : IQuery<T>
    {
        private IDataProvider m_DataProvider;
        private Expression<Func<T, bool>> m_QueryExpression;

        public LinqQuery(Expression<Func<T, bool>> queryExpression)
        {
            m_QueryExpression = queryExpression;
        }

        public Func<T, bool> GetQueryPredicate(IDataProvider dataProvider)
        {
            m_DataProvider = dataProvider;
            Func<T, bool> predicate = m_QueryExpression.Compile();
            return predicate;
        }
    }
}